package com.test.sdk.pay;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {
	
//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

	// 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
	public static String app_id = "2016080600178939";
	public static String seller_id = "2088102170174522";

	// 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDT23cDQRWv0ODCCJvH9oAVfkcg2MlFSal9OXs9P66bzwXbc3upskkX1XHv5FKiRU03hF47KZxFCU5pwS5Pd1kd8AT4qfr1sCnBkswbjPDcVWM+83sAhKhfGj3miG1l40xwse+btnuXSD1GhLxnG+zyUrcbyDF/ddbhhAUAYchjKD59sXbA808ZYF1RAsNaDwJsuecfSoUNf50vhXZr69Zk0KUPELkVyPOeB8Tb/uB8IPwwuQgM5vWk6ShICITEO9SXwGNMLDQFuMtSr/b4XcO7LCfaM6C7VNC7JiYICUokWtl9MTuM4oKhd/hIwXK360HvgGwBph48lHY+ElIQjC4FAgMBAAECggEAYZLqtWz8eAVT/wnH9cjqJPwL9mziBi9vCGW5BPSXjttCb1g41GdwkrGT0FDwXhxc+/zTCZyYhJNMshhvI9psCQXKxFxFYXLJSIY7y1SWemQ5WXz6Ybq3cVW8vLiI6ixNwHmzSZw6P+rdjeUEgNizwMen3fvOEE5NsYAEbbCbgk7oMG24BI7DSbtRlbdP3a4agz3J9Tl7AT1TpbrLQqCPo4C/aLr5DqGvZuzdWvhVSwcCDZCCkm4D9aiQf2aDXDiZDT6ZsoaKXQ6PUuJ39ukilaw1E1Sd8Ai0el/AAPzGUQoKq4TeYQTTdW160vvIsS6dDpcIVy2Euq23/AwHPw4oAQKBgQDriicWZIgmQAtNvSrXIGsIqmBgp6wRJPsJ3TXQnLBcUfmq/OOGvycmhFB7U4C/ZkZyLcLT1FZPyHe6kY8N7Pi1z8oYuaAGcPNQz91Mxx51dNjTJ/acjtLKlGbzEe+MVamAifHCpPSS6Sm9QLrFe0h9BmDnPdilNVOX32oQKHWGQQKBgQDmQqwGx23f+Sp9je7PEy++/T3MU+aCEOLYo4qZ9SDcOATAUVM+4IyDRh8yq0BzbWmGYHAhVWWCNVtTLvxBsNNCA4mr7as2Taf+iS+HK3h9tlthujr4VBOGbjm3iPTWLyxUOKm1ySp9K03jos4O5kSbi6iEk5Q93GtAq5DSMtBexQKBgEk7MtvrdckusFUDM4afNagEEOL8Pqs17Dcs58ZscQjDE/Ttm3ARjoKTMNKnK6hWjCCDycdChXNYyKDhELErtEgSyqrVS8O06nF9rzhn0DiEk8VS74HNhgwmB7wbH3dqSsEEIn55+vCSPb/xmCA+LFNy4D4FJI54/fyCId/UNHYBAoGBAOBhAe+NMQW7cWtt/tNtF+7eKfVNoOcH+3YuT6bdVwshz4d0+FDiUiquD0K53JFegiE/IqVo6QTsZ7T0qT5+SC8g8WxHqrq9C8Ke/mCSvNSL+hqOdl5815X9HWM7I5L/3wunN8F8aVoV882qXW/pddu5SRsAEMoDW8RmKzaZ67EdAoGAey7W+/oEJQnJ1AlaMJfnC0eY2CWoE/8RRYjsKqzw1gP9nKEFM1Dy+FtUqqPoYRhDX7JaJvn6gJK7hmftvlbnw/BWsiyKX+GhobRYs7y/4Cs7Qini0xMQZuwdl3VzQ86HVoUBph/+RJWSRj1EJkOeHF2FQRpbNO0+VWz0UZ/W2Jw=";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA2wjs4psQfj/OBqE2UOTwE+ZC3Y2BwZXxNOrOTUF3TqjqLpQT/V3CVUEq9p8FLe5bmccmNOmHDo28yWwKsCj1Kawtg+1zIrF0ETy7DzHg0TqxKKQkLAf7DfGn/Zs47yj4K3FN6BA04JTBM7/+5eKfDLmy6/OYAiDiC4D2Z4LnSaupzR4qsDI3Nhn7JT9VwcGHZLayRCeyyjYn/i/BJu4oj3kMR82D+jxvnmUuufX9BE3VNq0ZuOI1v/iE5jshbEcyHHBo5rer9nQ4LYAQdL1s6IMXlAGSQ6Ah7gJ21YSJ3KGQJL6xfA9FMXow2sFcBJw1L6vOW22m4q20kqGfTe18wQIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String notify_url = "http://2361k301i0.iok.la/callback.html";

	// 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String return_url = "http://2361k301i0.iok.la/return.html";

	// 签名方式
	public static String sign_type = "RSA2";
	
	// 字符编码格式
	public static String charset = "utf-8";
	
	// 支付宝网关
	public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";
	
	// 支付宝网关
	public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /** 
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

